<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.2.1.min.js"></script>
</head>
<body>
<div>我是div</div>
<div>我是div</div>
<div>我是div</div>
<button id="btn">click</button>
</body>
<script>
    $('button').click(function () {
        $('div').each(function (n,obj) {
            $(obj).html('我是第'+n+'个div');
        })
    })
    $('div').click(function () {
        $(this).css({'color':'red'});
    })
</script>
</html>